package com.assets.room.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.assets.room.entity.Dept;
import com.assets.room.entity.User;

import java.util.List;

@Dao
public interface DeptDao {

    @Insert
    void insertDept(Dept dept);

    @Insert
    void insertDept(List<Dept> dept);

    @Query("DELETE FROM sys_dept")
    void deleteAllData();

    @Query("SELECT * FROM sys_dept WHERE dept_id =:dept_id")
    Dept getDeptById(String dept_id);

    @Query("SELECT * FROM sys_dept WHERE dept_id =:dept_id")
    Dept getDeptById1(String dept_id);


    @Query("SELECT simple_name FROM sys_dept WHERE dept_id =:dept_id")
    String getNameById(String dept_id);

}
